package org.csu.mypetstore.controller;

import org.csu.mypetstore.domain.Account;
import org.csu.mypetstore.domain.Category;
import org.csu.mypetstore.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/mUser")
public class MuserController {

    @Autowired
    AccountService accountService;

    @GetMapping("/viewShowUser")
    public String viewShowUser(String choice, Model model){
        List<Account> accountList=accountService.getListAccount();
        model.addAttribute("accountList",accountList);
        model.addAttribute("choice",choice);
        System.out.println(accountList.get(0).getUsername()+"正在编辑用户信息"+choice);
            return "seller/mUser/showUser";
    }

}
